package com.itheima.putige.putige.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
<<<<<<< HEAD
 * Copyright (C), 2021-2022
 * Author: 16372
 * Date: 2022/3/1 19:59
 * FileName: MyBatisPlusConfig
 * Description: mp分页组件
 */
/*@Configuration
*//*public class MyBatisPlusConfig {
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return mybatisPlusInterceptor;
    }*/
/**
 * ClassName: MybatisPlusConfig
 * Description:  分页
 * date: 2022/3/1 19:36
 *
 * @author zjf95
 * @since JDK 1.8
 */
@Configuration
public class MybatisPlusConfig {

    @Bean
    public MybatisPlusInterceptor interceptor(){

        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        //分页拦截器
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());

        return mybatisPlusInterceptor;
    }

}
